package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2024-03-08
 * Time: 9:22
 */
class Money implements Cloneable{
    public double money = 12.5;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}

class Student implements Cloneable{
    public int age;
    public Money m = new Money();
    public Student(int age) {
        this.age = age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Student tmp = (Student)super.clone();
        tmp.m = (Money)this.m.clone();
        return tmp;
    }

    @Override
    public String toString() {
        return "Student{" +
                "age=" + age +
                '}';
    }
}

abstract class Cat {
    public String name;
    public int age;

    public Cat(String name,int age) {
        this.age = age;
        this.name = name;
    }

    public void miaomiao() {
        System.out.println(this.name + "喵喵喵");
    }
}

class A extends Cat {
    public A (){
        super("xiaohua",1);
    }

}

interface B {
    String name = "asb";
    int age = 1;
}

public class Test {
    public static void main(String[] args) {

    }

    /*public static void main2(String[] args) {
        A a = new A();
        a.miaomiao();
    }*/

    /*public static void main1(String[] args) throws CloneNotSupportedException {
        Student student1 = new Student(10);
        Student student2 = (Student)student1.clone();
        System.out.println(student1.m.money);
        System.out.println(student2.m.money);
        System.out.println("===================");
        student2.m.money = 100;
        System.out.println(student1.m.money);
        System.out.println(student2.m.money);
    }*/

}
